package com.tbit.manager.api;

import com.tbit.common.entity.view.Result;
import com.tbit.manager.api.dto.GiftCardUserDTO;
import com.tbit.manager.api.vo.UserGiftCardAreaVO;
import com.tbit.manager.enums.ApiConstants;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 区域礼品卡用户余额
 *
 * @author ：zhangtianyou
 * @since 2024/11/22
 */
@FeignClient(name = ApiConstants.NAME)
public interface GiftCardUserApi {

    String PREFIX = ApiConstants.PREFIX + "/giftCardUser";

    /**
     * 查询用户区域礼品卡余额
     *
     * @param accountId 用户区域id
     * @param userId    用户id
     * @return GiftCardUserDTO
     */
    @GetMapping(PREFIX + "/getGiftCard")
    GiftCardUserDTO getGiftCard(@RequestParam("accountId") Integer accountId, @RequestParam("userId") Integer userId);

    /**
     * 礼品卡修改
     */
    @PostMapping(value = PREFIX + "/rechargeGiftMoney", consumes = "application/json", produces = "application/json")
    Result<String> rechargeGiftMoney(@RequestBody GiftCardUserDTO giftCardUserDTO);

    /**
     * 获取用户修改礼品卡金额推荐区域
     *
     * @param userId 用户id
     */
    @GetMapping(PREFIX + "/getRecommendArea")
    List<UserGiftCardAreaVO> getUserGiftCardRecommendArea(@RequestParam("userId") Integer userId);
}
